all: installed

#
# Download, extract and compile from a released tarball:
#
TARBALL = build/sparsehash-1.12.tar.gz
TARBALL_URL = http://google-sparsehash.googlecode.com/files/sparsehash-1.12.tar.gz
INITIAL_DIR = build/sparsehash-1.12
SOURCE_DIR = build/sparsehash-tar
include $(shell rospack find mk)/download_unpack_build.mk

INSTALL_DIR = google_hash
CMAKE = cmake
CMAKE_ARGS = -D CMAKE_BUILD_TYPE="Release" -D CMAKE_INSTALL_PREFIX=`rospack find google_hash`/${INSTALL_DIR)
MAKE = make

installed: wiped $(SOURCE_DIR)/unpacked
	mkdir -p $(INSTALL_DIR)/include
	mkdir -p $(INSTALL_DIR)/include/google_hash
	mkdir -p $(INSTALL_DIR)/include/google_hash/sparsehash
	cp -r $(SOURCE_DIR)/src/google/* $(INSTALL_DIR)/include/google_hash
	cp -r $(SOURCE_DIR)/src/google/sparsehash/*.h $(INSTALL_DIR)/include/google_hash/sparsehash
	touch installed

clean:
	rm -rf build
	rm -rf $(INSTALL_DIR) installed

wiped: Makefile
	make wipe
	touch wiped

wipe: clean
	rm -rf build patched
